﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HDT.GUI
{
    public partial class FrmThemLoaiNV : Form
    {
        public delegate void MyDelegate(string TenLNV, int LuongCB);
        public MyDelegate AddLoaiNV;

        public FrmThemLoaiNV()
        {
            InitializeComponent();
        }

        private void btnQuayLai_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void btnThemLoaiNV_Click(object sender, EventArgs e)
        {
            string TenLNV = txtTenLoaiNV.Text;
            int LuongCB = int.Parse(txtLuongCB.Text);
            AddLoaiNV(TenLNV, LuongCB);
            this.Dispose();
        }

        private void txtLuongCB_KeyPress(object sender, KeyPressEventArgs e)
        {
            const char Delete = (char)8;
            e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
        }
    }
}
